<template>
  <div class="updateNoteComponent">
    <div class="titleBar">
      <div class="checkOut">
        <!-- @click="isActive()" :class="{ active: isCheck === 1 }" -->
        <div class="checkBox" @click="allCheckActive()" :class="{ active: allCheck === 1 }">
          <div class="checkCont">
            <span class="checkBtn"></span>
          </div>
          <span class="checkLabel">全选</span>
        </div>
      </div>
      <div class="container">内容</div>
      <div class="container">日期</div>
      <div class="container">操作</div>
    </div>
    <div class="poetrySearch">
      <div class="item bottomLine" v-for="(p, index) in updateNoteList" v-bind:key="index">
        <div class="checkOut">
          <div
            class="checkBox"
            @click="checkIsActive(index)"
            :class="{ active: p.isCheck === true }"
          >
            <div class="checkCont">
              <span class="checkBtn"></span>
            </div>
            <!-- <span class="checkLabel">全选</span> -->
          </div>
        </div>
        <div class="container">{{p.main}}</div>
        <div class="container">{{p.date | transformDate}}</div>
        <div class="tool">
          <span @click="openModal('alter', p)">
            <i class="el-icon-edit"></i>
          </span>
          <span @click="deleteOnce(p._id)">
            <i class="el-icon-delete"></i>
          </span>
        </div>
      </div>
    </div>
    <div class="paging">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="currentPage3"
        :page-size="10"
        layout="prev, pager, next, jumper"
        :total="pageCount"
      ></el-pagination>
    </div>
    <div class="actions">
      <el-button type="primary" @click="openModal('alter', null)">添加</el-button>
      <el-button type="danger" @click="deleteMany()">删除</el-button>
    </div>
    <CModal ref="modalSwitch" :plantType="2" @clickAdd="addFn" @clickUpdata="updataOnce"/>
  </div>
</template>

<script src="./updateNote.js"></script>

<style lang="scss">
@import './updateNote.scss';
</style>
